﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using CncConvProg.ViewModel.AuxViewModel.TreeViewModel;
using CncConvProg.ViewModel.MVVM_Library;

namespace CncConvProg.ViewModel.DummyViewModel
{
    public class MainScreenDummyViewModel
    {
        public ObservableCollection<DummyTreeItem> ReportDetailTreeview
        {
            get
            {
                var l = new ObservableCollection<DummyTreeItem>();
                var f = new DummyTreeItem();
                f.Voce = @"#1 Costo Lavorazione";
                f.Time = new TimeSpan(0, 2, 2, 32);
                f.IsRootItem = true;
                f.Children.Add(new DummyTreeItem()
                                   {
                                       Voce = "Dettaglio lavorazione",
                                       Time = new TimeSpan(0, 24, 3, 3),
                                   });

                l.Add(f);
                return l;
            }
        }
        public ObservableCollection<FaseDummyVm> TreeView
        {
            get
            {
                var l = new ObservableCollection<FaseDummyVm>();
                var f = new FaseDummyVm();
                f.Children.Add(new DummtLavVm());

                l.Add(f);
                return l;

            }
        }

    }
    public class DummyTreeItem
    {
        public bool IsRootItem { get; set; }
        public string Voce
        {
            get;
            set;
        }
        private TimeSpan _timeSpan;
        public TimeSpan Time
        {
            get { return _timeSpan.Subtract(TimeSpan.FromMilliseconds(_timeSpan.Milliseconds)); }
            set
            {
                _timeSpan = value;
            }
        }
        public bool IsExpanded
        {
            get { return true; }
            set
            {
                var l = value;
            }
        }
        public ObservableCollection<DummyTreeItem> Children { get; set; }

        public DummyTreeItem()
        {
            Children = new ObservableCollection<DummyTreeItem>();
        }

    }
    public class FaseDummyVm : DummyTreeItem
    {
        public string Label
        {
            get { return "fase di lavoro dasasd "; }
        }


    }
    public class DummtLavVm : DummyTreeItem
    {
        public int LavorazionePosition
        {
            get { return 1; }
        }
        public string Label
        {
            get { return "lavorazioneee dasasd "; }
        }

        public string IconSource
        {
            get { return @"pack://application:,,,/CncConvProg.View;component/Images/Work/MillFace_16.png"; }
        }

    }
}
